function turn_off (
	[int] $scenario,  #scenario 0..#s-1
	[int] $computer #ordinateur 0..#c-1
) { 
	$VMServer = $CONFIG_SERVERS[$computer]
	$sujet = $sujets[$scenario]
	
	# recherche des vms
	if(($vms_wmi = (get-vmwmi $vmServer $sujet))) {
		foreach($vm_wmi in $vms_wmi) {
			write-host (" TURN OFF "+($vm_wmi.Path.Server)+"\"+($vm_wmi.ElementName)) -foregroundcolor yellow
			
			if(($vm_wmi.EnabledState -ne [int][VMState]::Stopped) -AND ($vm_wmi.EnabledState -ne [int][VMState]::Stopping)) {
				$vm_wmi | Stop-VM -force
			} else {
				write-host "the virtual machine is already stopped" -foregroundcolor red
			}
		}
	}
}

$actions.Insert($actions.Count,"turn_off");
set-variable LANG_ACTION__TURN_OFF "ETEINDRE les vm" -scope global
